package com.asset.salesforce.handlers;

import com.asset.salesforce.R;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class DialogHandler {

	public static void listDialogHandler(Activity activity){
		AlertDialog.Builder builder = new AlertDialog.Builder(activity);
		builder.setTitle(R.string.dialog_title);

		ListView dialogList = new ListView(activity);
		 String[] dialogItems = activity.getResources().getStringArray(R.array.dialog_items);
		ArrayAdapter<String> modeAdapter = new ArrayAdapter<String>(activity, android.R.layout.simple_list_item_1, android.R.id.text1, dialogItems);
		dialogList.setAdapter(modeAdapter);
		builder.setView(dialogList);
		Dialog dialog = builder.create();
		dialog.show();
	}

}
